package cz.hanis.android.geography.models;

import cz.hanis.android.geography.GeographyApplication;
import cz.hanis.android.geography.WrongResourceException;

public class Continent {

//	public static final String EUROPE = "Evropa";
//	public static final String SOUTH_AMERICA = "Jížní Amerika";
//	public static final String NORTH_AMERICA = "Severní Amerika";
//	public static final String AFRICA = "Afrika";
//	public static final String AUSTRALIA = "Ausrálie";
//	public static final String ANTARCTICA = "Antarktida";
//	public static final String ASIA = "Asie";
//	public static final String ALL = "Všechny";
	
	
	private static final int NUMBER_OF_CONTINENTS = 7;
	
	public static final String EUROPE = "EU";
	public static final String SOUTH_AMERICA = "SA";
	public static final String NORTH_AMERICA = "NA";
	public static final String AFRICA = "AF";
	public static final String OCEANIA = "OC";
	//public static final String ANTARCTICA = "AN";
	public static final String ASIA = "AS";
	public static final String ALL = "ALL";
	
	
	public static String getIdByPosition(int position) {
		switch (position) {
		case 0: return Continent.EUROPE;
		case 1: return Continent.ASIA;
		case 2: return Continent.SOUTH_AMERICA;
		case 3: return Continent.NORTH_AMERICA;
		case 4: return Continent.AFRICA;
		case 5: return Continent.OCEANIA;
		//case 6: return Continent.ANTARCTICA;
		case 6: return Continent.ALL;
		default: return Continent.ALL;
		}
	}
	
	public static int getNumberOfContinents() {
		return NUMBER_OF_CONTINENTS;
	}

	public static String getNameByPosition(int position) {
		return getNamyById(getIdByPosition(position));		
	}
	
	public static String getNamyById(String id) {
		try {
			return GeographyApplication.getInstance().getStringValue("continent_" + id.toLowerCase());
		} catch (WrongResourceException e) {
			return "";
		}		
	}
	

	
	
	
}
